<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/page/jspf/prepare.jspf"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<%@include file="/page/jspf/head.jspf"%>
<script type="text/javascript">
	$(function(){
		$("#packageName").on("change", function(){
			var val = $(this).val();
			$("#p1").attr("data-value", val);
			$("#p3").attr("data-value", val);
		});
		$("#moduleName").on("change", function(){
			var val = $(this).val();
			$("#p2").attr("data-value", val);
			$("#p4").attr("data-value", val);
		});
		$("#p1").attr("data-value", $("#packageName").val());
		$("#p2").attr("data-value", $("#moduleName").val());
		
		$("#p3").attr("data-value", $("#packageName").val());
		$("#p4").attr("data-value", $("#moduleName").val());
	});
</script>
</head>
<body>
	<div class="row ">
		<div class="col-md-10 col-md-offset-1">
			<h4></h4>
			<hr />
			<form class="form-inline lookup" role="form" method="post">
				
				<div class="form-group">
					<label class="sr-only" for="lookup-tableName">表明</label> 
					<input	type="text" class="form-control" id="lookup-tableName" name="tableName" value="${ pager.lookup.tableName }" placeholder="请输入表名">
				</div>
	
				<div class="form-group">
					<label class="sr-only" for="lookup-comments">表说明</label> 
					<input	type="text" class="form-control" id="lookup-comments" name="comments" value="${ pager.lookup.comments }" placeholder="请输入表说明">
				</div>
	
	
				<div class="form-group form-btn-bar">
					<button type="submit" class="btn btn-primary btn-sm">
						<i class="glyphicon glyphicon-search"></i> 查询
					</button>
					<button type="button" class="btn btn-info btn-sm reset">
						<i class="glyphicon glyphicon-refresh"></i> 重置
					</button>
				</div>
	
			</form>
			<hr />
			<!-- 操作信息提示的地方 -->
			<c:if test="${ not empty remind}">
				<div class="alert alert-${ remind.level}">
					<button data-dismiss="alert" class="close" type="button">
						<i class="glyphicon glyphicon-remove"></i>
					</button>
					${ remind.message }
				</div>
			</c:if>
			<!--列表栏-->
			<form class="nocol">
			
				<div class="action-bar">
					<div class="form-inline">	
						<label for="packageName">包名:</label> 
						<input type="text" class="form-control" id="packageName"  value="com.winsky.ne" placeholder="请输入包名">
						<label for="moduleName">模块名:</label> 
						<input type="text" class="form-control" id="moduleName"  value="promotion" placeholder="请输入模块名">
						
						<button class="btn btn-sm btn-danger action-post" type="button"
							data-checkbox-required="tableNames" data-href="${ctx }/generator/export">
							<span class="glyphicon glyphicon-export"></span> 导出
							<i class="action-param" data-key="packageName" id="p1" data-value=""></i>
							<i class="action-param" data-key="moduleName" id="p2" data-value=""></i>
							
						</button>
					</div>
				</div>
	
				<table class="table table-striped table-bordered table-hover ">
					<thead>
						<tr class="text-center">
							<th><input type="checkbox" data-member="tableNames"></th>
							<th>表名</th>
							<th>Engine</th>
							<th>表备注</th>
							<th>创建时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody align="center">
						<c:forEach items="${ pager.datas}" var="cur" varStatus="status">
							<tr>
								<td class="center"><input type="checkbox" value="${ cur.tableName }" name="tableNames"></td>
								<td>${ cur.tableName }</td>
								<td>${ cur.engine }</td>
								<td title="${cur.comments }">${fn:substring(cur.comments, 0, 20)}${fn:length(cur.comments) gt 20 ? "..." : ""}</td>
								<td><fmt:formatDate value="${cur.createTime}" pattern="yyyy-MM-dd HH:mm"/></td>
								<td>
									<div class="btn-group-dis">
										<button class="btn btn-xs btn-info action-get"
											data-href="${ cur.tableName }" data-toggle="tooltip"
											title="详情" >
											<i class="	glyphicon glyphicon-list-alt"></i>
											<i class="action-param" data-key="packageName" id="p3" data-value=""></i>
											<i class="action-param" data-key="moduleName" id="p4" data-value=""></i>
										</button>
									
									</div>
								</td>
							</tr>
						</c:forEach>
						<c:forEach begin="${ fn:length(pager.datas)}" end="${ pager.size-1}">
							<tr>
								<td>&nbsp;</td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</form>
			<%@include file="/page/jspf/console-pager.jspf"%>
		</div>
		
	</div>	
	
</body>
</html>
